﻿<Window x:Class="wpf_ImageSearch.View.ImagePreviewWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
        xmlns:prismsupporti="clr-namespace:Okazuki.MVVM.PrismSupport.Interactivity;assembly=Okazuki.MVVM.PrismSupport"
        Height="350"
        Width="400"
        Topmost="True"
        x:Name="ipw">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        
        <Image Grid.Row="0" Source="{Binding Url}" Stretch="Uniform"/>
        <TextBlock Grid.Row="1" Text="{Binding Summary}" TextWrapping="Wrap"/>
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            
            <Button Grid.Column="0" Content="画像を開く">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <prismsupporti:StartProcessAction FileName="{Binding ClickUrl}"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>
            
            <Button Grid.Column="1" Content="掲載ページを開く">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <prismsupporti:StartProcessAction FileName="{Binding RefererUrl}"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>
            
            <Button Grid.Column="2" Content="閉じる">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <prismsupporti:WindowCloseAction/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>
        </Grid>
    </Grid>
</Window>
